package cscie160.project.atm;
import java.rmi.Remote;
import java.rmi.RemoteException;
import cscie160.project.bank.AccountInfo;
/**
 * This interface provides requirements for any ATM implementation
 * @author Michael Melnikov   
*/
public interface ATM extends Remote
{
    /**
    * deposits sum equal to its argument
    * @param accountInfo cscie160.project.bank.AccountInfo
    * @param amount int
    */
    public void deposit(AccountInfo accountInfo, int amount) throws ATMException, RemoteException;

    /**
    * withdraws sum equal to its argument
    * @param accountInfo cscie160.project.bank.AccountInfo 
    * @param amount int
    */
    public void withdraw(AccountInfo accountInfo, int amount) throws ATMException, RemoteException;

    /**
    * returns balance on the account
    * @param accountInfo cscie160.project.bank.AccountInfo
    * @return int
    */
    public int getBalance(AccountInfo accountInfo) throws ATMException, RemoteException;

    /**
    * makes transfer fro 1st to 2nd account.
    * withdraws sum equal to 3d argument from account defined by the 1st argument and deposits
    * it onto account defined by the 2nd argument
    * @param sourceAccountInfo cscie160.project.bank.AccountInfo
    * @param destAccountInfo cscie160.project.bank.AccountInfo
    * @param amount int
    * @return boolean
    */
    public boolean transfer(AccountInfo sourceAccountInfo,
        AccountInfo destAccountInfo, int amount)
        throws ATMException, RemoteException;

    /**
    * allows Client to register itself with the ATM as an ATMListener
    * @param client ATMListener
    * @return boolean
    */
    public boolean registerListener(ATMListener client) throws RemoteException;

    /**
    * notifies all registered listeners of the transaction
    * @param notification TransactionNotification
    */
    public void notifyListeners(TransactionNotification notification) throws RemoteException;

}